/**
 * @(#)BasePDBiz.java 1.0 2013/9/18
 * Copyright 2013 PD, Inc. All rights reserved.
 */
package cn.broadin.app.hotel.factory;

import cn.broadin.app.hotel.application.IApplication;
import cn.broadin.app.hotel.application.STB_FLAG;
import cn.broadin.app.hotel.bz.BasePDBiz;
import cn.broadin.app.hotel.bz.PDBizCommon;
import cn.broadin.app.hotel.bz.PDBizXiaoMi;
import android.app.Activity;
import android.util.Log;
import android.webkit.WebView;

/**
*
* BasePDBiz 逻辑factory
* @author fenghui
*
*/
public class PDBizFactory {
	
	private static final String TAG = "PDBizFactory";			//log tag
	private static BasePDBiz pdBiz = null;				//逻辑处理对象
	
	/**
	 * 获取全局变量对象
	 * @return
	 */
	public static BasePDBiz getPDBiz(Activity act, WebView webview) {
		//if(pdBiz == null) {
			switch (IApplication.STB_TAG_FLAG) {
			case STB_FLAG.COMMON:
				pdBiz = new PDBizCommon(act, webview);
				Log.i(TAG, "create PDBizCommon.");
				break;
			case STB_FLAG.XIAOMI:
				pdBiz = new PDBizXiaoMi(act, webview);
				Log.i(TAG, "create PDBizXiaoMi.");
				break;
			default:
				pdBiz = new PDBizCommon(act, webview);
				Log.i(TAG, "create default, PDBizCommon.");
				break;
			}
		//}
		return pdBiz;
	}
}